package com.macro.mall.dto;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;

import java.io.IOException;

@Data
public class XhsTokenResponse {
    private boolean success;
    private String msg;
    private int code;
    private TokenData data;

    // 添加静态解析方法
    public static XhsTokenResponse parseFromJson(String json) throws IOException {
        return new ObjectMapper().readValue(json, XhsTokenResponse.class);
    }

    @Data
    public static class TokenData {
        private String access_token;
        private int expire_in;
    }
}
